<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryRef"
      :inline="true"
      :rules="rules"
      v-show="showSearch"
    >
      <el-form-item label="日期" prop="postCode">
        <el-date-picker
          v-model="queryParams.value"
          type="datetime"
          placeholder="请输入日期"
        />
      </el-form-item>
      <el-form-item label="手机号" prop="postName">
        <el-input
          v-model="queryParams.postName"
          placeholder="请输入手机号"
          clearable
          style="width: 200px"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="Search" @click="handleQuery"  v-hasPermi="['news:message:smsRecord:add']">查询</el-button>
      </el-form-item>
    </el-form>
    <el-table
      v-loading="loading"
      :data="postList"
      >
      <el-table-column label="手机号码" align="center" prop="" />
      <el-table-column label="发送时间" align="center" prop="" />
      <el-table-column label="接收时间" align="center" prop="" />
      <el-table-column label="模板类型" align="center" prop="" />
      <el-table-column label="短信内容" align="center"  prop="" />
      <el-table-column label="字数" align="center" prop="" />
      <el-table-column label="发送条数" align="center" prop="" />
      <el-table-column label="发送状态" align="center" prop="" />
      <!-- <el-table-column label="创建时间" align="center" prop="createTime" width="180">
             <template #default="scope">
                <span>{{ parseTime(scope.row.createTime) }}</span>
             </template>
          </el-table-column> -->
    </el-table>
    <pagination
      v-show="total > 0"
      :total="total"
      v-model:page="queryParams.pageNum"
      v-model:limit="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script setup name="Post">
import { vacationRuleList } from "@/api/vacation/rule";
const { proxy } = getCurrentInstance();
const postList = ref([]);
const loading = ref(true);
const showSearch = ref(true);
const total = ref(0);
const data = reactive({
  form: {},
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    value: "",
    postName: undefined,
    status: undefined,
  },
  rules: {
    postName: [{ required: true, message: "手机号不能为空", trigger: "blur" }],
  },
});

const { queryParams, form ,rules} = toRefs(data);

/** 查询岗位列表 */
function getList() {
  loading.value = true;
  vacationRuleList(queryParams.value).then((response) => {
    postList.value = response.rows;
    total.value = response.total;
    loading.value = false;
  });
}
/** 表单重置 */
function reset() {
  form.value = {
    postId: undefined,
    postCode: undefined,
    postName: undefined,
    postSort: 0,
    status: "0",
    remark: undefined,
  };
  proxy.resetForm("postRef");
}
/** 搜索按钮操作 */
function handleQuery() {
  queryParams.value.pageNum = 1;
  getList();
}
getList();
</script>
